package com.ymm.system.core.repo;

import com.ymm.driver.api.constants.Entity.DriverEntity;
import com.ymm.driver.api.facade.DriverPersonalAllInformationService;
import com.ymm.driver.api.utils.Result;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;

/**
 * @Author zikang.yao
 * @Description 司机相关的rpc接口
 * @Date 2022/8/7 11:13
 * @Version 1.0
 */
@Component
public class DriverRelatedRepo {

    @Reference(version = "server")
    private DriverPersonalAllInformationService driverPersonalAllInformationService;

    public Result<DriverEntity> getDriverInfo(BigInteger driverId){
        return driverPersonalAllInformationService.driverSearchInfo(driverId);
    }

    public Result<List<DriverEntity>> batchGetDriverInfo(List<BigInteger> driverIds){
        return driverPersonalAllInformationService.batchSearchDriverInfo(driverIds);
    }

    public Result addDriverProfit(Long driverId, BigDecimal mount) {
        return driverPersonalAllInformationService.addDriverProfit(driverId, mount);
    }

}
